﻿package{
	
	public class StrokeCode{
		private var stroke:String;
		private var fillDirection:String;
		public function StrokeCode(s:String,f:String){
			this.stroke=s;
			this.fillDirection=f;			
			
			}
		public function getStrokeCode():Array{
			var ret:Array=new Array();
			switch(this.stroke){
					case "1":
						if(fillDirection=="1"){
							ret.push("1");//横
						}
						//this.fillDirection.push('0');
						break;
					case "2":
						if(fillDirection=="1"){
						//ret="竖";
						ret.push("2");
						//this.fillDirection.push('1');
						}
						break;
					case "3":
					case "23":
						if(fillDirection=="1"){
		    			ret.push("3");//撇
						//this.fillDirection.push('1');
						}
						break;
					case "31":
					
					
					if(fillDirection=="1"){
						ret.push("c");
						//ret="撇折";						
						//this.fillDirection=[1,0];
						}
						break;
					case "4":
					if(fillDirection=="1"){
						//ret="捺";
						ret.push("4");
						//this.fillDirection=[1];
					}
						break;
					case "242":
						 if(fillDirection=="10"){
							//ret="斜钩";
							ret.push("h");
							//this.fillDirection=[1,3];
							
							}
						break;
					case "42":
					 if (fillDirection=="10"){
							//ret="斜钩";
							ret.push("h");
							//this.fillDirection=[1,3];
							}
							break;
					case "5":
					if(fillDirection=="1"){
						//ret="提";
						ret.push("5");
						//this.fillDirection=[0];
					}
						break;
					case "6":
					if(fillDirection=="1"){
						ret.push("钩");
					}
						break;
					case "7":
					case "8":
						if(fillDirection=="1"){
						ret.push("7");//点
						//this.fillDirection=[1];
						}
						break;
					case "12":
					
						if(fillDirection=="1"){
						//ret="横折";
						ret.push("a");
						ret.push("f");
						ret.push("d");
						//this.fillDirection=[0,1];
						}
						break;
					case "13":
						if(fillDirection=="1"){
						//ret="横撇";
						ret.push("d");
						ret.push("a");
						ret.push("f");
						//this.fillDirection=[0,1];
						}
						break;
					
					case "21":
					if(fillDirection=="1"){
						//ret="竖横";
						ret.push("b");
						//this.fillDirection=[1,0];
					}
						break;
					case "25":
					if(fillDirection=="1"){
						//ret="竖提";
						ret.push("i");
						//this.fillDirection=[1,0];
						
					}
						break;
					case "26":
					if(fillDirection=="1"){
						//ret="竖钩";
						ret.push("g");
						//this.fillDirection=[1,2];
					}
						break;
					case "2126":
					
					
					case "3136":
					case "2136":
					
					case "3126":
					if(fillDirection=="1"){
						//ret="竖折折勾";
						ret.push("r");
						//this.fillDirection=[1,0,1,2];
					}
						break;
					case "12126":
					case "13136":
					case "12136":
					case "13126":
					//case "":
					if(fillDirection=="1"){
						//ret="横折横折勾";
						ret.push("q");
						//this.fillDirection=[0,1,0,1,2];
					}
						break;
						
					case "212":
						if(fillDirection=="10"){
						ret.push("m");
						//this.fillDirection=[1,0,3];
						//ret="竖弯勾";
						}
						else if(fillDirection=="1"){
							//ret="竖折竖";
							ret.push("w");
							//this.fillDirection=[1,0,1];
							
							}
						break;
					case "34":
					
					//case "37":
					if(fillDirection=="1"){
						//ret="撇捺";
						ret.push("e");
						//this.fillDirection=[1,1];
					}
						break;
					case "125":
					//case "135":
					if(fillDirection=="1"){
						//ret="横折提";
						ret.push("k");
						//this.fillDirection=[0,1,0];
					}
						break;
					case "2436":
					case "436":
					case "4236":					
					case "426":
					case "24236":					
					case "2426":
						//ret="弯钩";
						if(fillDirection=="1"){
						ret.push("l");
						//this.fillDirection=[1,3];
						}
						break;
					case "2432":
						if(fillDirection=="10"){
							ret.push("l");
							}
						break;
					case "432":
						if(fillDirection=="10"){
							ret.push("l");
							}
						break;
					case "4232":					
						if(fillDirection=="10"){
							ret.push("l");
							}
						break;
						
					case "24232":
						if(fillDirection=="10"){
							ret.push("l");
						}
						break;
					
					
					case "4312":
						if(fillDirection=="10")
						{
							ret.push("l");
							}
						break;
					case "42312":
						if(fillDirection=="10")
						{
							ret.push("l");
							}
						break;
					case "24312":
					if(fillDirection=="10")
						{
							ret.push("l");
							}
						break;
					
					
					case "45":
						//ret="斜钩";
						if(fillDirection=="1"){
						ret.push("h");
						//this.fillDirection=[1,3];
						}
						break;
					
						
						
						
					
					case "4156":
					case "24156":
					case "416":
					case "2416":
					case "456":
					case "2456":
					if(fillDirection=="1"){
						ret.push("u");
						//this.fillDirection=[0,3];
						//ret="";wogou
					}
						break;
					case "216":
					
					if(fillDirection=="1"){
						//ret="竖弯钩";
						ret.push("m");
						//this.fillDirection=[1,0,3];
					}
						break;
					case "121":
						if(fillDirection=="1"){
							
					
						//ret="横折横";
						ret.push("j");
						//this.fillDirection=[0,1,0];
						}
						break;
					
					case "1216":
					if(fillDirection=="1"){
						//ret="横折弯钩";
						ret.push("o");
						//this.fillDirection=[0,1,0,2];
					}
						break;
					case "1212":
						if(fillDirection=="10"){
							ret.push("o");
							}
						else if(fillDirection=="1"){
							ret.push("s");
							}
						break;
					case "142":
						if(fillDirection=="1"){
							//ret="捺";
							ret.push("4");
							//this.fillDirection=[1];
							}
						else if(fillDirection=="10"){
							ret.push("h");
							//this.fillDirection=[1,3];
							//ret="斜钩";
							}
					case "1212":
						if(fillDirection=="1"){
							ret.push("s");
							//this.fillDirection=[0,1,0,1];
							//ret ="横折折折";
							}
						else if (fillDirection=="10"){
							ret.push("o");
							//this.fillDirection=[0,1,0,3];
							
							//ret="横折折勾";							
							}
						break;
						
					case "13436":
					case "1326":
					case "13426":
					case "134236":
					case "134316":
					case "1342316":
					case "134232":
					case "13432":
					case "134312":
					case "1342312":
					if(fillDirection=="1"){
						ret.push("p");
						//this.fillDirection=[0,1,1,2];
						//ret="横撇弯钩";
					}
						break;
					
					
					case "1313":
					case "1213":
					
					if(fillDirection=="1"){
						ret.push("s");
						//this.fillDirection=[0,1,0,1];
						//ret="横折折折";
					}
						break;
					case "213":
					case "313":
					if(fillDirection=="1"){
						ret.push("t");
						//this.fillDirection=[1,0,1];
						//ret="竖折撇";
						
					}
						break;
					case "126":
					
					if(fillDirection=="1"){
					
					//case "14316":
					//case
						ret.push("n");//////////////////////////////////////////////////////////横折钩
						//this.fillDirection=[0,1,2];
					}
						break;
					case "13212":
					 if(fillDirection=="10"){
							ret.push("v");
							//this.fillDirection=[0,1,0,3];
							//ret="乙";
							}
						break;
					case "1312":
						if(fillDirection=="1"){
							ret.push("s");
							//this.fillDirection=[0,1,0,1];
							//ret="横折折折";
							}
							
						else if(fillDirection=="10"){
							ret.push("v");
							//this.fillDirection=[0,1,0,3];
							//ret="乙";
							}
						break;
					case "134152":
						//ret="乙";
						if(fillDirection=="1"){
						ret.push("v");
						}
						//this.fillDirection=[0,1,0,3];
						break;
					case "142":
						if(fillDirection=="10"){
							ret.push("x");//气
						}
						break;
						
					case "145":
					
					case "1245":
					if(fillDirection=="1"){
						ret.push("x");
					}
						break;
					case "1242":
						if(fillDirection=="10"){
							ret.push("x");
							}
							break;
					case "1343":
					case "132":
					case "1342":
					case "13423":
					case "13431":
					case "134231":
					case "132":
					case "134":
					if(fillDirection=="1"){
						ret.push("y");
					}
						//this.fillDirection=[0,1,1,2];
						//ret="横撇弯钩";
						break;
					default:
						ret.push("无法识别"+stroke);
						break;
					}
				return ret;
			
			}
		
		}
	
	
	}